/*******************************************************************************
 * Size: 21 px
 * Bpp: 1
 * Opts: 
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef SANS21
#define SANS21 1
#endif

#if SANS21

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+4E2D "中" */
    0x1, 0xc0, 0x0, 0x70, 0x0, 0x1c, 0x0, 0x7,
    0x0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x1c, 0x1f,
    0x87, 0x7, 0xe1, 0xc1, 0xf8, 0x70, 0x7e, 0x1c,
    0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x70, 0x70,
    0x1c, 0x0, 0x7, 0x0, 0x1, 0xc0, 0x0, 0x70,
    0x0, 0x1c, 0x0, 0x7, 0x0,

    /* U+4E91 "云" */
    0x3f, 0xff, 0x87, 0xff, 0xf0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0xff,
    0xff, 0xff, 0xff, 0x7, 0x80, 0x0, 0xe0, 0x80,
    0x3c, 0x38, 0x7, 0x7, 0x81, 0xc0, 0x70, 0x70,
    0x7, 0x1f, 0xff, 0xf3, 0xff, 0xfe, 0x3c, 0x1,
    0xe0, 0x0, 0x10,

    /* U+591A "多" */
    0x0, 0x80, 0x0, 0x38, 0x0, 0xf, 0xfc, 0x7,
    0xff, 0x83, 0xc0, 0xe0, 0xf4, 0x38, 0x9, 0xfe,
    0x0, 0x1f, 0x80, 0xf, 0xdc, 0x1f, 0xf7, 0x81,
    0xf1, 0xff, 0x20, 0xff, 0xf0, 0x7c, 0x1c, 0x3e,
    0x87, 0x3, 0x3b, 0xc0, 0x3, 0xf0, 0x0, 0xfc,
    0x1f, 0xfe, 0x1, 0xfe, 0x0, 0x3c, 0x0, 0x0,

    /* U+5927 "大" */
    0x0, 0xe0, 0x0, 0x1c, 0x0, 0x3, 0x80, 0x0,
    0x70, 0x0, 0xe, 0x0, 0x1, 0xc0, 0x3f, 0xff,
    0xff, 0xff, 0xff, 0x1, 0xf0, 0x0, 0x3e, 0x0,
    0x7, 0xc0, 0x1, 0xdc, 0x0, 0x7b, 0xc0, 0xe,
    0x3c, 0x3, 0x83, 0x80, 0xf0, 0x3c, 0x7c, 0x7,
    0xdf, 0x0, 0x3d, 0x80, 0x3, 0x0,

    /* U+5C0F "小" */
    0x0, 0x70, 0x0, 0x3, 0x80, 0x0, 0x1c, 0x0,
    0x0, 0xe0, 0x0, 0x7, 0x0, 0xe, 0x38, 0xc0,
    0x71, 0xc7, 0x3, 0x8e, 0x38, 0x1c, 0x70, 0xc0,
    0xc3, 0x87, 0xe, 0x1c, 0x38, 0x70, 0xe0, 0xe7,
    0x7, 0x7, 0x38, 0x38, 0x3b, 0xc1, 0xc0, 0xe4,
    0xe, 0x4, 0x0, 0x70, 0x0, 0x3, 0x80, 0x1,
    0xfc, 0x0, 0x7, 0xc0, 0x0,

    /* U+5FAE "微" */
    0x8, 0x61, 0x80, 0xe3, 0xc, 0xe, 0xdb, 0x60,
    0xe6, 0xdb, 0x6, 0xb6, 0xff, 0x7, 0xff, 0xf8,
    0x7f, 0xfc, 0xc3, 0x0, 0xec, 0x3b, 0xff, 0x63,
    0xdf, 0xfb, 0x1e, 0x0, 0x78, 0xf3, 0xf3, 0xc1,
    0x9f, 0x9c, 0xc, 0xcc, 0xe0, 0x66, 0x73, 0x3,
    0x73, 0xf8, 0x1b, 0xbb, 0xe0, 0xdc, 0xbb, 0x86,
    0xc1, 0x8c, 0x30, 0x8, 0x0,

    /* U+6674 "晴" */
    0x0, 0xc, 0x0, 0x1, 0x83, 0xf7, 0xff, 0xfe,
    0xff, 0xfc, 0xc0, 0xc1, 0x99, 0xff, 0xb3, 0x3,
    0x7, 0xef, 0xff, 0xfc, 0x0, 0x19, 0x9f, 0xfb,
    0x33, 0xff, 0x66, 0x60, 0x6c, 0xcf, 0xfd, 0x99,
    0xff, 0xbf, 0x30, 0x37, 0xe7, 0xfe, 0xc0, 0xc0,
    0xd8, 0x18, 0x18, 0x3, 0xf, 0x0, 0x61, 0xc0,

    /* U+66B4 "暴" */
    0x1f, 0xff, 0xc0, 0xe0, 0xe, 0x7, 0x0, 0x70,
    0x3f, 0xff, 0x81, 0xc0, 0x1c, 0xf, 0xff, 0xe0,
    0xc, 0x38, 0x7, 0xff, 0xfc, 0x3f, 0xff, 0xe0,
    0x18, 0x70, 0x1f, 0xff, 0xfc, 0xff, 0xff, 0xe0,
    0xe7, 0x3c, 0x3f, 0xb9, 0xf9, 0xcd, 0xd8, 0xc0,
    0x7f, 0x80, 0x1f, 0xff, 0x80, 0xef, 0x9e, 0x0,
    0x78, 0x0,

    /* U+6D2A "洪" */
    0x30, 0x61, 0x83, 0x86, 0x18, 0x3e, 0x61, 0x80,
    0xc6, 0x18, 0x3, 0xff, 0xf0, 0x3f, 0xff, 0x60,
    0x61, 0x8f, 0x86, 0x18, 0x38, 0x61, 0x81, 0x6,
    0x18, 0x0, 0x61, 0x80, 0x3f, 0xff, 0xf, 0xff,
    0xf0, 0xc0, 0x0, 0x1c, 0x61, 0x83, 0x8e, 0x1c,
    0x39, 0xc0, 0xe7, 0x3c, 0xe, 0x33, 0x80, 0x60,
    0x0, 0x0,

    /* U+7535 "电" */
    0x1, 0xc0, 0x0, 0x38, 0x0, 0x7, 0x0, 0x7f,
    0xff, 0xcf, 0xff, 0xf9, 0xc3, 0x87, 0x38, 0x70,
    0xe7, 0xe, 0x1c, 0xff, 0xff, 0x9f, 0xff, 0xf3,
    0x87, 0xe, 0x70, 0xe1, 0xcf, 0xff, 0xf9, 0xff,
    0xff, 0x38, 0x70, 0x38, 0xe, 0x7, 0x1, 0xc0,
    0xe0, 0x38, 0x1c, 0x7, 0xff, 0x0, 0x7f, 0xc0,

    /* U+9634 "阴" */
    0xfe, 0xff, 0xff, 0x7f, 0xf1, 0xb0, 0x79, 0xd8,
    0x3c, 0xcc, 0x1e, 0x67, 0xff, 0x73, 0xff, 0x99,
    0x83, 0xc6, 0xc1, 0xe3, 0x60, 0xf1, 0xbf, 0xf8,
    0xdf, 0xfd, 0xec, 0x1e, 0x66, 0xf, 0x3, 0x7,
    0x83, 0x83, 0xc1, 0x81, 0xe1, 0xc3, 0xf0, 0xc1,
    0xc0,

    /* U+96E8 "雨" */
    0xff, 0xff, 0xff, 0xff, 0xfc, 0x3, 0x80, 0x0,
    0x70, 0x0, 0xe, 0x0, 0xff, 0xff, 0x9f, 0xff,
    0xf3, 0x7, 0x6, 0x6c, 0xf8, 0xcd, 0xff, 0xd9,
    0x9f, 0x9b, 0x30, 0x70, 0x66, 0xcf, 0x8c, 0xfd,
    0xf9, 0x99, 0xfb, 0xb3, 0x17, 0x36, 0x60, 0xe0,
    0xcc, 0x1c, 0xf9, 0x83, 0x9e, 0x0,

    /* U+96EA "雪" */
    0x7f, 0xff, 0x9f, 0xff, 0xe0, 0xc, 0x3, 0xff,
    0xff, 0xc0, 0xc0, 0xf7, 0xb7, 0xbc, 0xc, 0xf,
    0x3, 0x3, 0x1e, 0xde, 0x0, 0x30, 0x3, 0xff,
    0xf0, 0xff, 0xfc, 0x0, 0x3, 0x7, 0xff, 0xc1,
    0xff, 0xf0, 0x0, 0xc, 0x3f, 0xff, 0xf, 0xff,
    0xc0, 0x0, 0x30,

    /* U+96F7 "雷" */
    0x7f, 0xff, 0x8f, 0xff, 0xf0, 0x3, 0x0, 0x7f,
    0xff, 0xff, 0xff, 0xff, 0x81, 0x81, 0xf7, 0xb7,
    0xbe, 0x6, 0x7, 0x3e, 0xdf, 0x7, 0xdb, 0xe0,
    0xff, 0xfe, 0x1f, 0xff, 0xc3, 0xc, 0x38, 0x7f,
    0xff, 0xf, 0xff, 0xe1, 0x86, 0x1c, 0x3f, 0xff,
    0x87, 0xff, 0xf0, 0xc0, 0xe, 0x0,

    /* U+96FE "雾" */
    0x3f, 0xff, 0xc0, 0x6, 0x0, 0x7f, 0xff, 0xe6,
    0x6, 0x6, 0x6f, 0x6f, 0x66, 0x6, 0x6, 0xf,
    0x6f, 0x0, 0x70, 0x0, 0x1f, 0xff, 0xc3, 0xe0,
    0x78, 0x23, 0xfe, 0x1, 0xff, 0xff, 0x7f, 0x9f,
    0xe0, 0x6, 0x0, 0x3f, 0xff, 0x80, 0x3c, 0x18,
    0x7, 0x83, 0x83, 0xe0, 0xf8, 0x18, 0xf, 0x0,

    /* U+971C "霜" */
    0x1f, 0xff, 0xc3, 0xff, 0xf8, 0x1, 0x80, 0x3f,
    0xff, 0xf6, 0x6, 0x6, 0xdf, 0xde, 0xc0, 0x18,
    0x0, 0x7f, 0x7c, 0x0, 0x60, 0x1, 0xc7, 0xfd,
    0xff, 0xc1, 0xbf, 0xf8, 0x30, 0xe3, 0xfe, 0x3e,
    0x60, 0xc7, 0xff, 0xf9, 0xf7, 0x83, 0xee, 0xb0,
    0x69, 0xc7, 0xfc, 0x38, 0xc1, 0x80,

    /* U+971E "霞" */
    0x7f, 0xff, 0x80, 0x18, 0x0, 0x3, 0x0, 0x7f,
    0xff, 0xfc, 0xc, 0xf, 0xbd, 0xbd, 0xcf, 0xb7,
    0xc1, 0xf6, 0xf8, 0x7f, 0xbf, 0xcc, 0x70, 0x39,
    0xfe, 0xff, 0x3f, 0xdf, 0xe6, 0x0, 0x0, 0xff,
    0x7f, 0x98, 0xc, 0x73, 0x0, 0xdc, 0x7f, 0x9f,
    0xc, 0xf, 0x7d, 0x81, 0x83, 0x0,

    /* U+9732 "露" */
    0x7f, 0xff, 0x80, 0x18, 0x0, 0x3, 0x0, 0x7f,
    0xff, 0xfc, 0xc, 0xf, 0xbd, 0xbd, 0xcf, 0xb7,
    0xc0, 0x0, 0xc0, 0x7f, 0x3f, 0xcc, 0x6e, 0x31,
    0x8f, 0xee, 0x3f, 0x8f, 0x81, 0xc3, 0xfc, 0xbf,
    0xe3, 0xd7, 0xcf, 0xe2, 0xe1, 0x8c, 0x5f, 0x31,
    0x8f, 0xe6, 0x33, 0xfc, 0xfe, 0x0,

    /* U+973E "霾" */
    0x1f, 0xff, 0xc0, 0x6, 0x0, 0x7f, 0xff, 0xf6,
    0x6, 0x7, 0x7f, 0x6f, 0xf0, 0x6, 0x0, 0x1f,
    0x6f, 0x80, 0x60, 0x0, 0x7e, 0x3f, 0xe7, 0xf3,
    0x66, 0x2f, 0xbf, 0xe7, 0xe3, 0x66, 0x4e, 0x3f,
    0xe1, 0xb0, 0x60, 0xf3, 0x6, 0x4, 0xf3, 0xfe,
    0x1b, 0x6, 0x6, 0xf7, 0xe0, 0xe, 0x7f, 0xf0,

    /* U+98CE "风" */
    0x3f, 0xff, 0x83, 0xff, 0xf8, 0x38, 0x3, 0x83,
    0x81, 0x38, 0x3a, 0x1b, 0x83, 0xf1, 0xb8, 0x3b,
    0xbb, 0x83, 0x9b, 0x38, 0x39, 0xf3, 0x83, 0x8e,
    0x38, 0x38, 0xe3, 0x83, 0x8f, 0x38, 0x71, 0xfb,
    0x87, 0x3b, 0xb8, 0x77, 0x9f, 0xa7, 0xf1, 0xdb,
    0xe6, 0x9, 0xbe, 0x0, 0x1f, 0x40, 0x0, 0xe0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 336, .box_w = 18, .box_h = 20, .ofs_x = 2, .ofs_y = -2},
    {.bitmap_index = 45, .adv_w = 336, .box_w = 19, .box_h = 18, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 88, .adv_w = 336, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 136, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -1},
    {.bitmap_index = 182, .adv_w = 336, .box_w = 21, .box_h = 20, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 235, .adv_w = 336, .box_w = 21, .box_h = 20, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 288, .adv_w = 336, .box_w = 19, .box_h = 20, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 336, .adv_w = 336, .box_w = 21, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 386, .adv_w = 336, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 436, .adv_w = 336, .box_w = 19, .box_h = 20, .ofs_x = 2, .ofs_y = -2},
    {.bitmap_index = 484, .adv_w = 336, .box_w = 17, .box_h = 19, .ofs_x = 2, .ofs_y = -2},
    {.bitmap_index = 525, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 571, .adv_w = 336, .box_w = 18, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 614, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 660, .adv_w = 336, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 708, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 754, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 800, .adv_w = 336, .box_w = 19, .box_h = 19, .ofs_x = 1, .ofs_y = -2},
    {.bitmap_index = 846, .adv_w = 336, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2},
    {.bitmap_index = 894, .adv_w = 336, .box_w = 20, .box_h = 19, .ofs_x = 1, .ofs_y = -2}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x64, 0xaed, 0xafa, 0xde2, 0x1181, 0x1847, 0x1887,
    0x1efd, 0x2708, 0x4807, 0x48bb, 0x48bd, 0x48ca, 0x48d1, 0x48ef,
    0x48f1, 0x4905, 0x4911, 0x4aa1
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 20013, .range_length = 19106, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 20, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 1,
    .bpp = 1,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
    .cache = &cache
#endif
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t sans21 = {
#else
lv_font_t sans21 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 20,          /*The maximum line height required by the font*/
    .base_line = 2,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -3,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};



#endif /*#if SANS21*/

